import request from '@/config/axios'

// 车辆里程记录 VO
export interface VehicleMileageRecordVO {
  id: number // 主键ID
  vehicleId: number // 车辆ID
  mileage: number // 里程数
  month: string // 里程月份，格式如2025-07
}

// 车辆里程记录 API
export const VehicleMileageRecordApi = {
  // 查询车辆里程记录分页
  getVehicleMileageRecordPage: async (params: any) => {
    return await request.get({ url: `/oa/vehicle-mileage-record/page`, params })
  },

  // 查询车辆里程记录详情
  getVehicleMileageRecord: async (id: number) => {
    return await request.get({ url: `/oa/vehicle-mileage-record/get?id=` + id })
  },

  // 新增车辆里程记录
  createVehicleMileageRecord: async (data: VehicleMileageRecordVO) => {
    return await request.post({ url: `/oa/vehicle-mileage-record/create`, data })
  },

  // 修改车辆里程记录
  updateVehicleMileageRecord: async (data: VehicleMileageRecordVO) => {
    return await request.put({ url: `/oa/vehicle-mileage-record/update`, data })
  },

  // 删除车辆里程记录
  deleteVehicleMileageRecord: async (id: number) => {
    return await request.delete({ url: `/oa/vehicle-mileage-record/delete?id=` + id })
  },

  // 导出车辆里程记录 Excel
  exportVehicleMileageRecord: async (params) => {
    return await request.download({ url: `/oa/vehicle-mileage-record/export-excel`, params })
  }
}
